package acm;

import java.io.BufferedInputStream;
import java.io.PrintStream;
import java.util.Scanner;

class TuXingJiSuan2
{
	static Scanner cin = new Scanner(new BufferedInputStream(System.in));
	static PrintStream cout = System.out;

	public static void main(String[] args)
	{
		for (int i = cin.nextInt(); i > 0; i--)
			figure();
	}

	private static void figure()
	{
		int m = cin.nextInt();
		
		double square = 0;
		double squareTemp = 0;
		Node g = new Node(0, 0);
		double gSum;
		
		Node[] nodes = new Node[m];
		
		for(int i=m; i>0; i--)
		{
			nodes[i-1] = new Node(cin.nextDouble(), cin.nextDouble());
		}
		
		Node begin = nodes[0];
		
		Node oldNode = nodes[1];
		Node newNode;
		
		for ( int i=2; i<m; i++ )
		{
			newNode = nodes[i];
			
			squareTemp = Math.abs((oldNode.x - begin.x) * (newNode.y - begin.y) - (newNode.x - begin.x) * (oldNode.y - begin.y)) / 2;
			
			g.x += squareTemp * (begin.x + newNode.x + oldNode.x) / 3;
			g.y += squareTemp * (begin.y + newNode.y + oldNode.y) / 3;
			square += squareTemp;
			
			oldNode = newNode;
		}
		
		if (square < 1e-9)
		{
			gSum = 0;
		} 
		else
		{
			gSum = (g.x + g.y) / square;
		}

		cout.printf("%.3f %.3f\n", square, gSum);
	}
	
	private static class Node
	{
		double x;
		double y;

		public Node(double x, double y)
		{
			this.x = x;
			this.y = y;
		}
	}
}